convert 1 digit to 2 digit python

35

convert 1 digit to 2 digit python -

number = 10
print(number) #Output: 10
zero_filled_number = str(number).zfill(3)
print(zero_filled_number) #Output: "010"

Comments

Submit
0 Comments